<?php  
echo $this->session->flash(); 
if(!empty($payableList)){
    $this->Paginator->options(array(
        'update' => '#divUpdate',
        'evalScripts' => true, 
        'url' => array('controller' => 'Reports', 'action' => 'checkPayable')
    ));
} ?>
<div class="file" id="List">
    <table width="100%" border="0" cellspacing="1" cellpadding="2" bgcolor="#686550">
        <tr class="heading"  bgcolor="#708089">
            <td width="6%" valign="top" align="left"><?php echo __('S.NO') ?></td>
            <td valign="top"  align="left"><?php echo  __('ENG_NAME', true); ?></td>
            <td valign="top"  align ="left"><?php echo __('PAYEE_ID_PROOF_NO', true); ?></td>
            <td valign="top"  align ="left"><?php echo __('COUNT', true); ?></td>
        </tr>
        <?php
        if (isset($payableList) && count($payableList) > 0) {
            $i = 0;
            foreach ($payableList as $arrayDetail) {
                ?>
                <tr class="heading2" bgcolor="#ffffff">
                    <td>&nbsp;<?php echo $i + 1 ?></td>
                    <td><?php
                        echo $this->Js->link(
                                $arrayDetail['Payee']['eng_name'], 
                                array(
                                    'controller' => 'reports',
                                    'action' => 'view_details',$arrayDetail['Payee']['id'], $switch
                                ), 
                                array(
                                    'update' => '#detailDiv',
                                    'alt' => __('DETAILS', true),
                                    'title' => __('DETAILS', true),
                                    'escape'=>false,
                                    'before' => $this->Js->get('#detailDiv')->effect('fadeOut'),
                                    'success' => $this->Js->get('#detailDiv')->effect('fadeIn'),
                                    'style' => 'color:#e18f00; font-weight:bold; text-decoration: underline;'
                                )
                            );
                        ?>
                    </td>
                    <td>&nbsp;<?php echo $arrayDetail['Payee']['payee_id_proof_no']; ?></td>
                    <td>&nbsp;<?php echo isset($arrayDetail['Payable']['count']) ? $arrayDetail['Payable']['count']. ' ' .__('ITEM_FOUND') : '--';?> </td>
                </tr>  
                <?php
                $i++;
            }
        }
        ?>
        <tr>
            <td colspan="12" bgcolor="#ffffff" align="center">
                <div class="pagination">            
                    <?php
                    if (!empty($payableList)) {
                        echo $this->Element('pagination');
                    } else {
                        echo __("NO_RECORD_MESSAGE");
                    }
                    ?>              
                </div>
            </td>
        </tr>
    </table>
</div>

<div id="detailDiv" style="margin-top:20px;"></div>
        <!-- Div update ends here -->
<?php echo $this->Js->writeBuffer();?>